<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>支付订单</title>
    <meta charset="utf-8"/>
    <link rel="stylesheet" type="text/css" href="iconfont/iconfont.css">
    <link rel="stylesheet" type="text/css" href="css/nanhang.css">
    <link rel="stylesheet" type="text/css" href="css/booking.css">
    <link rel="stylesheet" type="text/css" href="css/order.css"/>
    <script src="https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
    <script type="text/javascript" src="IIInsomniaCityPicker/js/jquery.cookie.js"></script>

    <script src="js/top.js"></script>
	<script src="js/nanhang.js"></script>
    <script>
        <!--从URL获取传递的参数并赋给对应的Span-->
        $(function(){
            var orderId= GetQueryString("orderid");
            var flightPrice= GetQueryString("flightprice");
            $.ajax({
                url:"/order/showUserOrder",
                type:"post",
                dataType:"json",
                data:{
                    "orderId":orderId
                },
                success:function(orderInfo){
                    $('#deptCity').text(orderInfo.deptcity);
                    $('#arrCity').text(orderInfo.arrcity);
                    $('#deptDate').text(date_reversal_Date(orderInfo.flightdate));
                    $('#deptTime').text(date_reversal_Time(orderInfo.flightdate));
                    $('#flightNo').text(orderInfo.flightno);
                    $('#linkManinfo').text(orderInfo.linkman);
                    $('#linkPhone').text(orderInfo.linkphone);
                    document.getElementById("price").value=orderInfo.price;
                    document.getElementById("payid").value=orderInfo.id;

                }
            });

        });

        $(function(){
            var orderId= GetQueryString("orderid");
            $.ajax({
                url:"/order/passengInfo",
                type:"post",
                dataType:"json",
                data:{
                    "orderId":orderId
                },
                success:function(passengInfo){
                     var i = passengInfo.length;

                    for(var j=0;j<i-1;j++){
                        var addinfo=$('.ckxx:first-child').clone(true);
                        $('.ckxx:last-child').after(addinfo);

                    }
                    for(var k=0;k<$('.ckxx').length;k++){
                        $('.ckxx').eq(k).find('.ck-name').attr('id','ck-name'+k);
                        $('.ckxx').eq(k).find('.sfz_1').attr('id','sfz'+k);
                    }
                    for(var j=0 ;j<i;j++){
                        $('#ck-name'+j).text(passengInfo[j].passname);
                        $('#sfz'+j).text(passengInfo[j].idno);

                    }

                }
            });

        });



        function date_reversal_Date(var1) {
            var date = new Date(var1);
            Y = date.getFullYear() + '-';
            M = (date.getMonth()+1 < 10 ? '0'+(date.getMonth()+1) : date.getMonth()+1) + '-';
            D = date.getDate() + ' ';
            h = date.getHours() + ':';
            m = date.getMinutes() + ':';
            s = date.getSeconds();
            console.log(Y+M+D+h+m+s);
            return Y+M+D;

        }
        function date_reversal_Time(var1) {
            var date = new Date(var1);
            Y = date.getFullYear() + '-';
            M = (date.getMonth()+1 < 10 ? '0'+(date.getMonth()+1) : date.getMonth()+1) + '-';
            D = date.getDate() + ' ';
            h = date.getHours() + ':';
            m = date.getMinutes();
            s = date.getSeconds();
            console.log(Y+M+D+h+m+s);
            return h+m;

        }
        function GetQueryString(name)
        {
            var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
            var URL =  decodeURI(window.location.search);
            var r = URL.substr(1).match(reg);
            if(r!=null)return  unescape(r[2]); return null;
        };
    </script>
</head>
<body>
<form action="/alipay/alipay" method="post">
    <div class="container">
        
        <div class="middle">
            <div class="con">
                <div class="plan">
                    <div class="dot"></div>
                    <ul>
                        <li>
                            <div>
                                1
                            </div>
                            <span>航班查询</span>
                            <div></div>
                        </li>
                        <li>
                            <div>
                                2
                            </div>
                            <span>航班选择</span>
                            <div></div>
                        </li>
                        <li >
                            <div>
                                3
                            </div>
                            <span>旅客信息</span>
                            <div></div>
                        </li>
                        <li class="active">
                            <div >
                                4
                            </div>
                            <span>支付订单</span>
                            <div></div>
                        </li>
                        <li>
                            <div>
                                5
                            </div>
                            <span>完成支付</span>
                        </li>
                    </ul>
                    <div class="clear"></div>
                </div>
                <div class="pstishi">航班剩余票数紧张,您的座位暂未锁定,请尽快支付</div>
                <div class="ddxx">
                    <p class="ddxx_1"><span class="ddxx_11">订单信息</span><span class="ddh" >订单号:<input class="ddh_no"  name="payid" id="payid"></span></p>
                    <div class="ddxx_2">
                        <div class="schedule">
                            <p class="way">[单程]</p>
                            <p class="airport">
                                <span class="first_airport" id="deptCity"></span>
                                <span id="arrCity"></span>
                            </p>
                            <div class="qfrq">
                                <p class="qfrq_1">起飞日期:</p>
                                <p class="qfrq_rq"id="deptDate"></p>
                                <p class="time"><span class="time_1"id="deptTime"></span>-<span class="time_2">15:30</span></p>
                                <p class="cw">[<span id="flightNo"></span>,经济舱]</p>

                            </div>
                        </div>
                        <div>
                            <div class="ckxx">
                                <p class="ck">乘客信息:</p>
                                <p class="ck_1" ><span class="ck-name">[成人]</span></p>
                                <p class="sfz">身份证:</p>
                                <p class="sfz_1"></p>

                            </div>
                        </div>
                        <div class="lxxx">
                            <p class="mz">联系人信息:</p>
                            <p class="mz_1"id="linkManinfo"></p>
                            <p class="phone">手机:</p>
                            <p class="phone_1"id="linkPhone"></p>
                            <p class="yx">邮箱:</p>
                            <p class="yx_1"id="linkEmail">847855629@qq.com</p>
                        </div>
                        <div class="clear"></div>
                        <div class="zj">
                            <p>总价&nbsp;
                                <input class="zj_no"  name="price" id="price" >
                            <!--<span id="price" name="price">&yen;1170</span></p></div>-->
                            </p>
                        </div>
                </div>
                <div class="wxts">
                    <p>*温馨提示：</p>
                    <p>1、航班价格变动频繁，剩余票数紧张，请您尽快支付，此订单仅限官网支付。</p>
                    <p>2、该订单仅能支付一次，如果支付失败，请重新下单，并以重新下单的价格为准。</p>
                    <p>3、您购买的航线仅能通过南航以下的网关进行支付，给您带来不便，请您谅解。</p>
                </div>
                <div class="zffs">
                    <div class="zffs_1"></div>
                    <div class="xz">
                        <input type="radio"/>
                    </div>
                    <div class="zxzf">
                        <input type="submit" value="执行支付">
                    </div>
                </div>


            </div>
            </div>
        </div>
    </div>

    <footer>
        <div class="footerL">Copyright(C)1997-2017 中国南方航空股份有限公司 版权所有 粤ICP备05053330号</div>
        <div class="footerR">
            <a href="">关于南航｜</a>
            <a href=""> 投资者关系｜</a>
            <a href=""> 预订须知 ｜</a>
            <a href=""> 常见问题 ｜</a>
            <a href=""> 联系我们｜ </a>
            <a href=""> "十分"关爱基金会</a>
        </div>
        <div class="clear"></div>
    </footer>
</form>
</body>
</html>